package com.nlgc365.designpattern.Chapter03_;

import jdk.jshell.spi.ExecutionControl;

import java.rmi.UnexpectedException;

public class MyClass {
   public static void main(String[] args) {    
       MyClass obj = new MyClass();   
       obj.instanceMethod();    
       staticMethod();   
   }

   public void instanceMethod() {    
       System.out.println("Instance method called");    
       staticMethod();  // 添加这一行  
   }

   public static void staticMethod()/* throws UnexpectedException*/ {
       System.out.println("Static method called");
       //throw new RuntimeException("");
       //throw new UnexpectedException("");
   }
}
